package com.cos.lession70.slice;

import com.cos.lession70.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;

public class NextAbilitySlice extends AbilitySlice {

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        /* 加载页面布局 */
        /* Layout_ability_next  layout=>layout文件夹 next =>ability_next.xml */
        /* 设置界面内容 */
        setUIContent(ResourceTable.Layout_ability_next);
        System.out.println("NextAbilitySlice--------------onStart");
    }

    /**
     * 当前Page进入active状态进入到手机前台获取焦点时，会触发onActive方法的执行
     */
    protected void onActive() {
        super.onActive();
        System.out.println("NextAbilitySlice--------------onActive");
    }
    /**
     * 当前PageAbility失去焦点（页面切入到后台、切换到其他Page），触发onInactive方法的执行
     */
    protected void onInactive() {
        super.onInactive();
        System.out.println("NextAbilitySlice--------------onInactive");
    }
    /**
     * 当前PageAbility切换到后台，不可见时，触发onBackground执行
     */
    protected void onBackground() {
        super.onBackground();
        System.out.println("NextAbilitySlice--------------onBackground");
    }
    /**
     *  当PageAbility从后台不可见状态（页面在后台、但是没销毁）切换到前台可见状态时触发 onForeground执行
     */
    protected void onForeground(Intent intent) {
        super.onForeground(intent);
        System.out.println("NextAbilitySlice--------------onForeground");
    }
    /**
     * 当前Page销毁时，触发onStop的执行
     */
    protected void onStop() {
        super.onStop();
        System.out.println("NextAbilitySlice--------------onStop");
    }
}
